home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / win.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.1 KB  |  77 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call createApp
  10. call SetNotifies
  11.  
  12. call set("win","open",1)
  13. call getattr("win","open","o")
  14. if o=0 then do
  15.     say "can't open window"
  16.     exit
  17. end
  18.  
  19. call handleApp
  20. exit
  21. /***********************************************************************/
  22. handleApp: procedure
  23.     ctrl_c=2**12
  24.     do forever
  25.         call newhandle("APP","H",ctrl_c)
  26.         if and(h.signals,ctrl_c)>0 then exit
  27.         select
  28.             when h.event="QUIT" then exit
  29.             otherwise interpret h.event
  30.         end
  31.     end
  32.     exit
  33. /***********************************************************************/
  34. err: procedure expose sigl rxmuierror
  35. parse arg res
  36. say signl "["res"]"
  37.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  38.     exit
  39. /***********************************************************************/
  40. createApp: procedure
  41.     app.Title="LitteExample"
  42.     app.Version="$VER: LitteExample 1.0 (10.12.99)"
  43.     app.Copyright="©1999, alfie"
  44.     app.Author="alfie"
  45.     app.Description="Just a little example"
  46.     app.Base="EXAMPLE"
  47.     app.SubWindow="WIN"
  48.      win.ID="MAIN"
  49.      win.Title="A LitteExample"
  50.      win.Contents="MGROUP"
  51.       mgroup.0="G"
  52.        g.frame="GROUP"
  53.        g.class="GROUP"
  54.        g.columns=2
  55.        g.0=label("_Name","DOUBLE")
  56.        name.cyclechain=1; g.1=String("NAME","n")
  57.        g.2=label("_Surname","DOUBLE")
  58.        surname.cyclechain=1; g.3=String("surname","s")
  59.  
  60.     res=NewObj("APPLICATION","APP")
  61.     if res~=0 then call err(res)
  62.     return
  63. /***********************************************************************/
  64. setNotifies: procedure
  65.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  66.     if res~=0 then call err(res)
  67.  
  68.     res=Notify("name","newcontents","everytime","APP","RETURN","say h.newcontents","triggerattr")
  69.     if res~=0 then call err(res)
  70.  
  71.     return
  72. /***********************************************************************/
  73. halt:
  74. break_c:
  75.     exit
  76. /**************************************************************************/
  77.